package com.qiantu.phone.ui.activity;

import android.content.Intent;
import android.view.View;

import com.qiantu.phone.R;
import com.qiantu.phone.app.AppActivity;

public class AddConditionActivityNew extends AppActivity {
    //创建场景或者联动入口
    public static final int TYPE_SCENE_LINKAGE = 0;
    //创建联动条件入口
    public static final int TYPE_LINKAGE = 1;
    private View addTiming;
    private View addSunrise;
    private View addEnvironment;
    private View addDeviceStateChange;
    private View addPanelAction;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_add_condition_new;
    }

    @Override
    protected void initView() {
        addTiming = findViewById(R.id.add_timing);
        addSunrise = findViewById(R.id.add_sunrise);
        addEnvironment =  findViewById(R.id.add_environment);
        addDeviceStateChange = findViewById(R.id.add_device_state_change);
        addPanelAction = findViewById(R.id.add_panel_action);
        setTitle(R.string.add_condition);
        setOnClickListener(addTiming, addSunrise, addEnvironment, addDeviceStateChange,addPanelAction);
    }

    @Override
    protected void initData() {

    }

    @Override
    public void onClick(View view) {
        if (view == addTiming){
            Intent intent = new Intent(this, EditTimeActivityNew.class);
            intent.putExtra("isAdd",true);
            startActivity(intent);
        }else if (view == addSunrise){
            Intent intent = new Intent(this, SunriseSunSetActivityNew.class);
            intent.putExtra("isAdd",true);
            startActivity(intent);
        }else if (view == addEnvironment){
            Intent intent = new Intent(this, EnvironmentActivityNew.class);
            startActivity(intent);
        }else if (view == addDeviceStateChange){
            Intent intent = new Intent(this, SelectDeviceActivity.class);
            intent.putExtra("type", SelectDeviceActivity.TYPE_SELECT_TRIGGER_DEVICE_NEW);
            startActivity(intent);
        }else if (view == addPanelAction){
            Intent intent = new Intent(this, SelectDeviceActivity.class);
            intent.putExtra("type", SelectDeviceActivity.TYPE_PANEL_DEVICE);
            startActivity(intent);
        }
    }
}